module shader.litshadernormal;

import shader.abstractshader;
import scene.scene;
import scene.ray;
import scene.intersection;
import std.math;
import utils.color;
import utils.vector3;

class LitShaderNormal: AbstractShader {
    public void getColor(inout Ray ray, inout Intersection inters,
        inout RGBColor col)
    {
        Vector3f n = mScene.getNormal(inters);
        float a = fabs(n*ray.dir);
        col *= a;
    }

    public char[] toString() {
        return "Normal";
    }
}
